package com.abaaba.project2.exceptionhandler;

import com.abaaba.project2.bean.vo.BaseRespVo;
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionControllerAdvice {

    @ExceptionHandler({InvalidFormatException.class, BindException.class,NumberFormatException.class})
    @ResponseBody
    public BaseRespVo invalidFormatException(){
    return BaseRespVo.fail(402,"参数值不对");
    }


}
